Manages the effects available in the component. More...
Public Member Functions | |
| Effect * | createOrRetrieve (const nkMemory::StringView &name, EFFECT_TYPE type) |
| Effect * | get (const nkMemory::StringView &name) |
| Effect * | getByIndex (unsigned int id) |
| void | rename (const nkMemory::StringView ¤tName, const nkMemory::StringView &newName) |
| void | erase (const nkMemory::StringView &name) |
Manages the effects available in the component.
At all times, manager owns any memory allocated inside. External code should never delete memory returned by it.
| Effect* nkAstraeus::EffectManager::createOrRetrieve | ( | const nkMemory::StringView & | name, |
| EFFECT_TYPE | type | ||
| ) |
Creates if unavailable, or retrieves if available, an effect.
Depending on the parameter given for the type, the Effect instance retrieved will be :
To address it fully, casting is required. For instance :
| name | The name of the effect to retrieve. |
| type | The effect type to create. |
| Effect* nkAstraeus::EffectManager::get | ( | const nkMemory::StringView & | name | ) |
Retrieves an effect.
| name | The name of the effect to retrieve. |
| Effect* nkAstraeus::EffectManager::getByIndex | ( | unsigned int | id | ) |
Get an effect, by index. Note that one index can map to a different effect after memory is changed. Useful to loop over all available effects in one go.
| id | The index of the effect to retrieve. |
| void nkAstraeus::EffectManager::rename | ( | const nkMemory::StringView & | currentName, |
| const nkMemory::StringView & | newName | ||
| ) |
Renames an effect.
| currentName | The name of the effect to rename. |
| newName | The name to reassign to the effect. |
| void nkAstraeus::EffectManager::erase | ( | const nkMemory::StringView & | name | ) |
Erases and frees an effect.
| name | The name of the effect to erase. |